package cn.powerone.scm.service.impl;

import java.util.List;
import cn.powerone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.powerone.scm.mapper.ScmStatsCustomerMonthlyMapper;
import cn.powerone.scm.domain.ScmStatsCustomerMonthly;
import cn.powerone.scm.service.IScmStatsCustomerMonthlyService;

/**
 * 客户月度统计信息-总Service业务层处理
 * 
 * @author PowerOne
 * @date 2025-09-09
 */
@Service
public class ScmStatsCustomerMonthlyServiceImpl implements IScmStatsCustomerMonthlyService 
{
    @Autowired
    private ScmStatsCustomerMonthlyMapper scmStatsCustomerMonthlyMapper;

    /**
     * 查询客户月度统计信息-总
     * 
     * @param id 客户月度统计信息-总主键
     * @return 客户月度统计信息-总
     */
    @Override
    public ScmStatsCustomerMonthly selectScmStatsCustomerMonthlyById(Long id)
    {
        return scmStatsCustomerMonthlyMapper.selectScmStatsCustomerMonthlyById(id);
    }

    /**
     * 查询客户月度统计信息-总列表
     * 
     * @param scmStatsCustomerMonthly 客户月度统计信息-总
     * @return 客户月度统计信息-总
     */
    @Override
    public List<ScmStatsCustomerMonthly> selectScmStatsCustomerMonthlyList(ScmStatsCustomerMonthly scmStatsCustomerMonthly)
    {
        return scmStatsCustomerMonthlyMapper.selectScmStatsCustomerMonthlyList(scmStatsCustomerMonthly);
    }

    /**
     * 新增客户月度统计信息-总
     * 
     * @param scmStatsCustomerMonthly 客户月度统计信息-总
     * @return 结果
     */
    @Override
    public int insertScmStatsCustomerMonthly(ScmStatsCustomerMonthly scmStatsCustomerMonthly)
    {
        scmStatsCustomerMonthly.setCreateTime(DateUtils.getNowDate());
        return scmStatsCustomerMonthlyMapper.insertScmStatsCustomerMonthly(scmStatsCustomerMonthly);
    }

    /**
     * 修改客户月度统计信息-总
     * 
     * @param scmStatsCustomerMonthly 客户月度统计信息-总
     * @return 结果
     */
    @Override
    public int updateScmStatsCustomerMonthly(ScmStatsCustomerMonthly scmStatsCustomerMonthly)
    {
        scmStatsCustomerMonthly.setUpdateTime(DateUtils.getNowDate());
        return scmStatsCustomerMonthlyMapper.updateScmStatsCustomerMonthly(scmStatsCustomerMonthly);
    }

    /**
     * 批量删除客户月度统计信息-总
     * 
     * @param ids 需要删除的客户月度统计信息-总主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsCustomerMonthlyByIds(Long[] ids)
    {
        return scmStatsCustomerMonthlyMapper.deleteScmStatsCustomerMonthlyByIds(ids);
    }

    /**
     * 删除客户月度统计信息-总信息
     * 
     * @param id 客户月度统计信息-总主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsCustomerMonthlyById(Long id)
    {
        return scmStatsCustomerMonthlyMapper.deleteScmStatsCustomerMonthlyById(id);
    }
}
